package com.jeeplus.modules.monitor.task;

import com.jeeplus.common.utils.SpringContextHolder;
import com.jeeplus.modules.buzz.remindsend.mapper.RemindSendMapper;
import com.jeeplus.modules.buzz.remindsend.service.RemindSendService;
import com.jeeplus.modules.monitor.entity.Task;
import com.jeeplus.modules.sys.mapper.SystemMapper;
import com.jeeplus.modules.sys.mapper.UserMapper;
import org.quartz.DisallowConcurrentExecution;
import org.springframework.beans.factory.annotation.Autowired;

@DisallowConcurrentExecution
public class SqlAutoBack extends Task {
	private static UserMapper userMapper = SpringContextHolder.getBean(UserMapper.class);
	private static SystemMapper systemMapper = SpringContextHolder.getBean(SystemMapper.class);

	@Autowired
	private RemindSendService remindSendService;
	@Autowired
	private RemindSendMapper remindSendMapper;

	@Override
	public void run() {
		systemMapper.sqlAutoBack();
		System.out.println("数据库备份成功E盘backup。");
		/*String wxName = "";
		User user = new User();
		Role role = new Role();
		role.setEnname("sktx");
		List<User> userList = userMapper.findListtx(new User(role));
		if (userList != null && userList.size() > 0) {
			for (User user1 : userList) {
				user.setLoginName(user1.getLoginName());
				wxName = userMapper.getByLoginName(user).getWxname();
				SendWX.send(wxName, "数据库备份成功E盘backup，测试待办推送！", new TaskEntity());
			}
		}*/
	}
}


